﻿using QYmall.Core.Common.Emum;
using QYmall.Core.Model.Models;
using QYmall.Core.Model.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace QYmall.Core.IServices
{
    /// <summary>
    /// 商品分类接口
    /// </summary>
    public interface IShopCategoryService : IBaseService
    {
        /// <summary>
        /// 根据父ID返回一级列表
        /// </summary>
        Task<IEnumerable<ShopCategory>> QueryListAsync(int top, int parentId, int status, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 根据租户ID与父ID返回一级列表
        /// </summary>
        Task<IEnumerable<ShopCategory>> QueryListMerchantIdAsync(int merchantId, int top, int parentId, int status, WriteRoRead writeAndRead = WriteRoRead.Read);


        /// <summary>
        /// 根据父ID返回目录树
        /// </summary>
        Task<IEnumerable<ShopCategoryDto>> QueryListAsync(int parentId, int status, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 根据租户ID与父ID返回目录树
        /// </summary>
        Task<IEnumerable<ShopCategoryDto>> QueryListByMerchantIdAsync(int merchantId, int parentId, int status, WriteRoRead writeAndRead = WriteRoRead.Read);


        /// <summary>
        /// 根据条件删除数据(迭代删除)
        /// </summary>
        Task<bool> DeleteAsync(Expression<Func<ShopCategory, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 根据父ID返回一级列表(带商品)
        /// </summary>
        Task<IEnumerable<ShopCategoryGoodsClientDto>> QueryGoodsListAsync(int categoryTop, int goodsTop, int status,
            Expression<Func<ShopGoods, bool>> funcWhere, string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);
    }
}
